<script>
  highlight_subnav('goodslist');
</script>
<style type="text/css">
.tab-ui{
    width: 100%;
    padding: 0;
    margin: 0;
    list-style: none;
    text-align: center;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}
.tab-ui li{
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
}

</style>
 <!-- 内容区域 -->
 <div class="tpl-content-wrapper">
            <div class="row-content am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                            <div class="row">
                                    <div class="am-u-sm-6">
                                        <div  class="am-tabs am-tabs-d2 am-no-layout" style="margin: 10px;"> 
                                            <ul class="am-tabs-nav am-cf tab-ui" >
                                                <li>
                                                    <a href='<?php echo $base_url;?>admin/refund/index'>待退押金列表</a>
                                                </li>
                                                <li  class="am-active"><a >已退押金列表</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                             
                  
                            </div>
                            <div class="widget-body  am-fr">

                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-6">
                                    <div class="am-form-group">
                                      
                                    </div>
                                </div>
                                <form action="<?php echo $base_url ?>admin/refund/refunded?" method="get" id="form">

                                <div class="am-u-sm-6 am-u-md-6 am-u-lg-3">

                                    <div class="am-form-group tpl-table-list-select">
                                        <select data-am-selected="{btnSize: 'sm'}" name="activity_id" id='activity_id'>
                                         <?php foreach($activity as $key => $value){?>
                                              <option value="<?php echo $value['activity_id']?>" <?php if(isset($_GET['activity_id'])){if($_GET['activity_id'] == $value['activity_id']){echo "selected";}}?>><?php echo $value['activity_name']?></option>
                                              <?php }?>
                                        </select>
                                    </div>
                                </div>

                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                                    <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                        <input type="text" name="sourch" value="<?php if(isset($_GET['sourch'])){echo $_GET['sourch'];}?>" placeholder="请输入用户姓名/用户手机号" class="am-form-field ">
                                        <span class="am-input-group-btn">
                                            <input class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search" id="submit" type="submit" value="搜索">
                                        </span>
                                    </div>
                                </div>
                                </form>
                             <div class="am-u-sm-12">
                                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">
                                        <thead>
                                            <tr>
                                                <th>订单号</th>
                                                <th>订单详情号</th>
                                                <th>用户姓名</th>
                                                <th>用户手机号</th>
                                                <th>状态</th>
                                                <th>产品总数</th>
                                                <th>总金额</th>
                                                <th>已退押金</th>
                                                <th>支付方式</th>
                                                <th >下单时间</th>
                                                <th>查看详情</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php foreach($torefund as $key => $value): ?>
                                                <tr class="gradeX">
                                                        <td class="am-text-middle"><?php echo $value['order_id']; ?></td>
                                                        <td class="am-text-middle"><?php echo $value['order_detail_id']; ?></td>
                                                        <td class="am-text-middle"><?php echo $value['username']; ?></td>
                                                        <td class="am-text-middle"><?php echo $value['mobile']; ?></td>
                                                       
                                                        <td class="am-text-middle">
                                                            <?php 
                                                                if($value['status'] == 1)
                                                                    echo '支付成功';
                                                                else if($value['status'] == 2)
                                                                    echo '已发货'; 
                                                                else if($value['status'] == 3)
                                                                    echo '未支付';
                                                                else if($value['status'] == 4)
                                                                    echo '超时';
                                                                else if($value['status'] == 5)
                                                                    echo '已退押金';
                                                            ?>
                                                        </td>
                                                        
                                                        <td class="am-text-middle"><?php echo $value['amount']; ?></td>
                                                        <td class="am-text-middle"><?php echo $value['price']; ?></td>
                                                        <td class="am-text-middle"><?php echo $value['return_money']; ?></td>
                                                       
                                                        <td class="am-text-middle">
                                                            <?php 
                                                                if($value['paytype'] == 1 || $value['paytype'] == 2)
                                                                    echo '微信';
                                                                else if($value['paytype'] == 3)
                                                                    echo '支付宝';
                                                            ?>
                                                        </td>
                                                        <td class="am-text-middle">
                                                            <?php 
                                                                echo date('Y-m-d H:i:s', $value['create_time']);
                                                            ?>
                                                        </td>
                                                        <td>
                                                            <div class="tpl-table-black-operation">
                                                                <a href="<?php echo $base_url;?>admin/refund/refunddetail?order_detail_id=<?php echo $value['order_detail_id'];?>">
                                                                    <i class="am-icon-pencl"></i>退款明细
                                                                </a>
                                                            </div>
                                                        </td>
                                                </tr>
                                            <?php endforeach; ?>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="am-u-lg-12 am-cf">
                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            <?php echo $page; ?>    
                                            <!-- <li class="am-disabled"><a href="#">«</a></li>
                                            <li class="am-active"><a href="#">1</a></li>
                                            <li><a href="#">2</a></li>
                                            <li><a href="#">3</a></li>
                                            <li><a href="#">4</a></li>
                                            <li><a href="#">5</a></li>
                                            <li><a href="#">»</a></li> -->
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div> 
                </div>
            </div>
        </div>
    </div>
</body>

<script type="text/javascript">
    $(function(){
        

        //搜索点击时间
 

        //导出excel文件
        $("#export").on('click', function(){
            var activity_id = $('#activity_id option:selected').val();

            window.location.href = '<?php echo $base_url ?>admin/refund/exportToRefunded?' 
                                    + 'activity_id=' + activity_id;
        });

      
    })
</script>

</html>


       
